/*
 * @FilePath: /tads/server/core/sdk/service/service.go
 * @Author: wnina0x0
 * @Date: 2025-04-14 15:30:39
 * @Description:
 *
 * 版权信息 : 2025 by wnina0x0, All Rights Reserved.
 */
package service

import (
	"fmt"
	"tads/server/core"

	"gorm.io/gorm"
)

type Service struct {
	Postgres *gorm.DB
	Error    error
	Log      *core.Logger
}

func (db *Service) AddError(err error) error {
	if db.Error == nil {
		db.Error = err
	} else if err != nil {
		db.Error = fmt.Errorf("%v; %w", db.Error, err)
	}
	return db.Error
}
